package com.zhuangwei.controller;

import com.zhuangwei.pojo.User;
import com.zhuangwei.service.UserConsumerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author LeviCoder
 * @create 2019-03-09 23:19
 */
@RestController
@RequestMapping("/consumer")
public class ConsumerController {
    @Autowired
    private UserConsumerService service;

    @GetMapping
    public List<User> consume(@RequestParam("ids") List<Long> ids) {
        return this.service.findByIds(ids);
    }
}
